// 1.沙旅列表
function getTravelList(page, img, byTime) {
    if (byTime == undefined || byTime == "" || byTime == null) {
        byTime = "no";
    }
    $("#travelList").html("");
    $
            .ajax({
                url : "/SofaGuest/travel/qryTravelList.do",
                type : "post",
                data : {
                    "page" : page,
                    "byTime" : byTime
                },
                dataType : "json",
                success : function(result) {
                    if ("0000" == result.status) {
                        var travels = result.data;
                        for ( var i = 0; i < travels.length; i++) {
                            var noteId = travels[i].note_id;
                            var noteTatile = travels[i].note_tatile;
                            var author = travels[i].real_name;
                            var ctime = travels[i].send_date;
                            var tr = '<tr><td width="3%"><img src="'
                                    + img
                                    + '" /></td>'
                                    + '<td width=""><a href="Javascript:void(0)" class="newstitle" onclick="trvelDetail(this)">[我的沙旅]'
                                    + noteTatile + '</a></td>' + '<td width=140px;><span class="author">' + author
                                    + '</span></td>' + '<td width="10%";><span class="ctime">' + ctime
                                    + '</span></td></tr>';
                            var $tr = $(tr);
                            $tr.data("noteId", noteId);
                            $("#travelList").append($tr);
                        }
                    }
                    else {
                        $("#travelList").html("暂无游记");
                    }
                },
                error : function() {
                    alert("系统异常,请稍后重试");
                }
            });
}

// 2. 沙旅详情
function trvelDetail(a) {
    var $a = $(a);
    var noteId = $a.parent().parent().data("noteId");
    addCookie("noteId", noteId, 2);
    window.location.href = "travelDetail.html";
}
